
package com.example.moments.dao;

import androidx.room.Dao;
import androidx.room.Query;

import com.example.moments.ssmemo.entity.Comment;
import com.example.moments.ssmemo.entity.Image;

import java.util.List;

@Dao
public interface ImageDao extends BaseDao<Image> {

    @Query("DELETE FROM "+ Image.TABLE_NAME)
    void clearAll();
    
    @Query("SELECT * FROM " + Image.TABLE_NAME)
    List<Image> getAll();

    @Query("SELECT * FROM " + Image.TABLE_NAME + " where id = :id limit 1")
    Image getById(Long id);

    @Query("SELECT * FROM " + Image.TABLE_NAME + " WHERE id IN (:ids)")
    List<Image> loadAllByIds(Long[] ids);

    @Query("SELECT * FROM " + Image.TABLE_NAME+ " where contentId = :contentId " )
    List<Image> getAllByContentId(Long contentId);
}
